class Test(object):
    def __init__(self):
        self.__number = 100

    #property 装饰词修饰
    @property
    def num(self):
        print("----getter----")
        return self.__number

    @num.setter
    def num(self, newNumber):
        print("---setter---")
        self.__number = newNumber


t = Test()
t.num = 200
print(t.num)
